<template>
  <view class="container">
    <view class="header">自定义卡片组件</view>
    <view class="news-list">
      <NewsCard 
        v-for="(item, idx) in newsList" 
        :key="idx" 
        :title="item.title" 
        :source="item.source" 
        :comment="item.comment" 
        :time="item.time" 
        :is-top="item.isTop" 
        :has-search="item.hasSearch" 
        :tags="item.tags" 
      />
    </view>
  </view>
</template>

<script>
import NewsCard from "../../components/NewCard.vue"
export default {
  components: { NewsCard },
  data() {
    return {
      newsList: [
        {
          title: "14个月从100家开到1000家门店，蜜雪冰城为何买下这家精酿啤酒商",
          source: "界面新闻",
          comment: "56评",
          time: "2025.10.07",
          isTop: true,
          hasSearch: false,
          tags: []
        },
        {
          title: "把握历史大势 共创美好未来（观沧海）",
          source: "人民日报",
          comment: "1025评",
          time: "2025.10.25",
          isTop: false,
          hasSearch: false,
          tags: []
        },
        {
          title: "黄金还能走多远？卖方高呼“第三浪启动”，230多份研报看多",
          source: "财联社",
          comment: "452评",
          time: "2025.10.08",
          isTop: false,
          hasSearch: true,
          tags: ["今日金行", "精选好财"]
        },
        {
          title: "“没有短板”的完美战鹰！歼-16机库独家探访",
          source: "红星新闻",
          comment: "56评",
          time: "2025.10.07",
          isTop: false,
          hasSearch: false,
          tags: []
        },
        {
          title: "多国学者共探巴克特里亚考古 携手推进丝绸之路文明研究新进程",
          source: "中国日报网",
          comment: "56评",
          time: "2025.10.12",
          isTop: false,
          hasSearch: false,
          tags: []
        }
      ]
    };
  }
};
</script>

<style scoped>
.container {
  padding: 10rpx;
}
.header {
  font-size: 36rpx;
  font-weight: bold;
  margin-bottom: 10rpx;
}
.news-list {
  padding: 10rpx 0;
}
</style>